<html>
<head>
<link rel="shortcut icon" href="./favicon.ico">
<link rel="stylesheet" type="text/css" href="./style.css">
<link rel="canonical" href="./open.html">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Work in Progress. Some open digital design questions I still haven't solved.">
<title>Open Design Questions</title>
</head>
<body>

<h1>Open Design Questions</h1>

<p>As I write out design elements, some questions about how to design them open
up. The following cases are to explore later, or for the designer to watch out
for.

<h2>Implementing and Generalizing Multiplexers</h2>

<p>Implementing a universal multiplexer module (any number of
inputs of a given width, using a binary selector) is straightforward using a
Verilog vector part select. Implementing it using design elements first suggests
using NOT-AND logic to select an input, which would require complex conditional
generation of NOT gates in a Verilog generate block.

<p>However, viewing the problem as one of address decoding, then one can use a
much simpler generate loop to iterate over the range of selector values and
instantiate a single address decoder module (which already exists) for each
case, without any conditional logic. This approach also generalizes the
original vector part select design since we could use arbitrary,
non-consecutive sets of selector values by passing them as a concatenation in a
parameter.

<p>This latter approach also removes the need for Verilog-specific vector part
selects, which would make the multiplexer design element portable across HDLs.

<h2>Implementing Synchronous Resets</h2>

<p>There seems to be different ways to infer a synchronous reset for FPGA
flip-flops: using an AND gate to zero the output results in separate logic,
while using a multiplexer to select a zero output results in using the built-in
synchronous reset of the flip-flop. This appears to be simple pattern matching
by the synthesis tool. Either approach is desirable depending on the design,
and can be encapsulated and made explicit by the Register design element.

<hr><a href="./index.html">Back to FPGA Design Elements</a>
</body>
</html>
